package com.iwop.moto.service.impl;

import com.iwop.moto.model.MOrderService;
import com.iwop.moto.model.SuperRecordModel;
import com.iwop.moto.service.BaseService;
import com.iwop.moto.service.FOrderServiceService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2016/9/1.
 */
@Service
public class FOrderServiceServiceImpl extends BaseService implements FOrderServiceService {
    @Override
    public void insertStoreOrder(SuperRecordModel SRModel) {
        getSqlSession().insert("FOrderServiceMapper.insertStoreOrder",SRModel);
    }

    @Override
    public void insertStoreGoods(SuperRecordModel SRModel) {
        getSqlSession().insert("FOrderServiceMapper.insertStoreGoods",SRModel);
    }

    @Override
    public void updateStoreOrder(SuperRecordModel SRModel) {
        getSqlSession().update("FOrderServiceMapper.updateStoreOrder",SRModel);
    }

    @Override
    public SuperRecordModel getStoreOrder(SuperRecordModel SRModel) {
       return getSqlSession().selectOne("FOrderServiceMapper.getStoreOrder",SRModel);
    }

    @Override
    public void updateStoreOrderStatus(SuperRecordModel SRModel) {
         getSqlSession().selectOne("FOrderServiceMapper.updateStoreOrderStatus",SRModel);
    }

    @Override
    public List<SuperRecordModel> getStoreOrderDetail(String sid) {
        return getSqlSession().selectList("FOrderServiceMapper.getStoreOrderDetail",sid);
    }

    @Override
    public void deleteStoreOrderDetail(String sid) {
        getSqlSession().delete("FOrderServiceMapper.deleteStoreOrderDetail", sid);
    }

    @Override
   public List<SuperRecordModel> getStoreOrderDetailList(SuperRecordModel SRModel) {
        return getSqlSession().selectList("FOrderServiceMapper.getStoreOrderDetailList",SRModel);
    }

    @Override
    public SuperRecordModel getStoreOrderBySid(String sid) {
        return getSqlSession().selectOne("FOrderServiceMapper.getStoreOrderBySid", sid);
    }

    @Override
    public List<SuperRecordModel> getStoreOrderList(SuperRecordModel SRModel) {
        return getSqlSession().selectList("FOrderServiceMapper.getStoreOrderList", SRModel);
    }

    @Override
    public SuperRecordModel getStoreOrderDetailByServiceId(SuperRecordModel SRModel) {
        return getSqlSession().selectOne("FOrderServiceMapper.getStoreOrderDetailByServiceId", SRModel);
    }

    @Override
    public List<SuperRecordModel> getStoreServiceForUserList(SuperRecordModel SRModel) {
        return  getSqlSession().selectList("FOrderServiceMapper.getStoreServiceForUserList", SRModel);
    }

    @Override
    public List<SuperRecordModel> getStoreOrderByService(String service_id) {
        return  getSqlSession().selectList("FOrderServiceMapper.getStoreOrderByService", service_id);
    }

    @Override
    public SuperRecordModel getStoreOrderByOrderNo(String outTradeNo) {
        return getSqlSession().selectOne("FOrderServiceMapper.getStoreOrderByOrderNo", outTradeNo);
    }
    @Override
    public MOrderService getStoreOrderByOrderNoAndPushStatus(MOrderService mOrderService) {
        return getSqlSession().selectOne("FOrderServiceMapper.getStoreOrderByOrderNoAndPushStatus", mOrderService);
    }

    @Override
    public SuperRecordModel getStoreOrderByPayOrderNo(String payOrderNo) {
        return getSqlSession().selectOne("FOrderServiceMapper.getStoreOrderByPayOrderNo", payOrderNo);
    }

    @Override
    public SuperRecordModel findStoreOrderByOrderId(String outTradeNo) {
        return getSqlSession().selectOne("FOrderServiceMapper.findStoreOrderByOrderId", outTradeNo);
    }
}
